#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "rngs.h"

#define DEBUG 0
#define NOISY_TEST 1

// Function being tested: int fullDeckCount(...) {...}

int TfullDeckCount(int player, struct gameState *state)
{
  int x, countA, countB = 0;
  countA = state->handCount[player] + state->deckCount[player] + state->discardCount[player];
  for(x = 0; x < 27; x++){
	countB = countB + fullDeckCount(player, x, state);
  }
  printf(" countA = %d    countB = %d\n", countA, countB);
  
  //assert(countA == countB);
  return 0;
}


int main()
{
  int x, y, randomPlayer;
  struct gameState newGame;
  printf("Now Testing: int fullDeckCount(...) {...}\n");

  SelectStream(2);
  PutSeed((long)14);

  for(x = 0; x < 10; x++){
    for (y = 0; y < sizeof(struct gameState); y++){
      ((char*)&newGame)[y] = Random() * 100;
    }
    randomPlayer = floor(Random() * MAX_PLAYERS);
    newGame.handCount[randomPlayer] = Random() * MAX_HAND;
    newGame.deckCount[randomPlayer] = Random() * MAX_DECK;
    newGame.discardCount[randomPlayer] = Random() * MAX_PLAYERS;
    TfullDeckCount(randomPlayer, &newGame);
  }

  printf("Everything checks out according to this test.\n");

  return 0;
}
